]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
boxpointer: fix left/right arrow side calculation
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Mon, 1 Jul 2013 16:37:59 +0000 (18:37 +0200)
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Mon, 1 Jul 2013 16:42:00 +0000 (18:42 +0200)
Commit d6cace32 introduced a typo in the left/right arrow side
calculation code that causes in most scenarios (where the monitor
width is greater then the height) to not flip the box when it doesn't
fit inside the monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=703403

js/ui/boxpointer.js

index 9f85e0254d483660fa564122137e6db20e9c17d6..2fd1a67c3add1d8f8d8186969fc50b64a75b4a1a 100644 (file)
@@ -589,12 +589,12 @@ const BoxPointer = new Lang.Class({
                 return St.Side.TOP;
             break;
         case St.Side.LEFT:
-            if (sourceAllocation.y2 + boxWidth > monitor.x + monitor.width &&
+            if (sourceAllocation.x2 + boxWidth > monitor.x + monitor.width &&
                 boxWidth < sourceAllocation.x1 - monitor.x)
                 return St.Side.RIGHT;
             break;
         case St.Side.RIGHT:
-            if (sourceAllocation.y1 - boxWidth < monitor.x &&
+            if (sourceAllocation.x1 - boxWidth < monitor.x &&
                 boxWidth < monitor.x + monitor.width - sourceAllocation.x2)
                 return St.Side.LEFT;
             break;